package vue;

import controleur.EcouteurDeSourisEdition;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Enumeration;
import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import modele.Joueur;
import modele.pion.Pion;
import modele.pion.nautique.Nautique;
import modele.pion.terrestre.Terrestre;

/**
 *
 * @author gervaila
 */
public class InfosEdition extends InfosPanel {

	/**
	 * Creates new form PanneauLateral
	 */
	public InfosEdition() {
		initComponents();
	}

	/**
	 * Crée un info panel d'édition pour le joueur 'joueur'
	 *
	 * @param joueur le joueur concerné par ce panel
	 * @param aire l'aire de jeu
	 */
	public InfosEdition(final Joueur joueur, final AireDeJeu aire) {
		super(joueur, aire);
		initComponents();
		couleurJoueurPanel.setBackground(joueur.getCouleurOpaque());
		nomJoueur.setText(joueur.getNom());
		progressSous.setString(joueur.getSous() + "$");
		progressSous.setMinimum(0);
		progressSous.setMaximum(joueur.getSous());


		tabTerrestreP.setLayout(new GridLayout(0, 1));
		tabNautiqueP.setLayout(new GridLayout(0, 1));
		tabAerienP.setLayout(new GridLayout(0, 1));

		for (final Class classePion : joueur.getEpoque().getTypePions()) {
			Pion pion = Pion.getTypePion(classePion);
			final BoutonModele pan = new BoutonModele();

			ActionListener al = new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					((EcouteurDeSourisEdition) aire.getEcouteur()).setPionCourant(classePion);
					afficherInfosPion(classePion);
					aire.creerBufferCasesPositionnable(joueur, Pion.getTypePion(classePion));
					aire.actualiserBuffers();
				}
			};

			MouseListener ml = new MouseAdapter() {
				@Override
				public void mousePressed(MouseEvent e) {
					pan.getjBoutton().doClick();
				}
			};

			pan.setTexteBoutton(pion.toString() + " (" + pion.getPrix() + "$)");
			pan.addActionListenerBoutton(al);
			pan.setImage(new ImageIcon(pion.getBufferedImage()));
			pan.addMouseListenerImage(ml);



			typePionButtonGroup.add(pan.getjBoutton());
			if (pion instanceof Terrestre) {
				tabTerrestreP.add(pan);
			} else if (pion instanceof Nautique) {
				tabNautiqueP.add(pan);
			} else {
				tabAerienP.add(pan);
			}
		}
		typePionButtonGroup.getElements().nextElement().setSelected(true);


		if (tabTerrestreP.getComponents().length == 0) {
			tabPanel.remove(tabTerrestreP);
		}
		if (tabNautiqueP.getComponents().length == 0) {
			tabPanel.remove(tabNautiqueP);
		}
		if (tabAerienP.getComponents().length == 0) {
			tabPanel.remove(tabAerienP);
		}
	}

	@Override
	public void activerPanel() {
		Enumeration<AbstractButton> b = typePionButtonGroup.getElements();
		AbstractButton bCourant = b.nextElement();
		while (!bCourant.isSelected()) {
			bCourant = b.nextElement();
		}
		bCourant.doClick();
		bTerminer.requestFocus();
		progressSous.setValue(joueur.getSous());
		progressSous.setString(joueur.getSous() + "$");
	}

	@Override
	public void actualiserPanel() {
		activerPanel();
	}

	/**
	 *
	 * @param classePion
	 */
	public void ajouterTypePion(Class classePion) {
		Pion pion = Pion.getTypePion(classePion);
		if (pion instanceof Terrestre) {
			tabTerrestreP.add(new Label(pion.toString()));
		} else if (pion instanceof Nautique) {
			tabNautiqueP.add(new Label(pion.toString()));
		} else {
			tabAerienP.add(new Label(pion.toString()));
		}
	}

	private void afficherInfosPion(Class classePion) {
		Pion pion = Pion.getTypePion(classePion);

		//nom = new JLabel(pion.toString());
		labelNom.setText(pion.toString());
		labelPv.setText("" + pion.getPv());
		labelportee.setText("" + pion.getPortee());
		labelPuissance.setText("" + pion.getPuissance());
		labelRayon.setText("" + pion.getRayon());
		labelDissipation.setText("" + pion.getDissipation());
		labelPrix.setText("" + pion.getPrix() + "$");
		//image.setIcon(new ImageIcon(aire.getImagePion(pion.getImage())));

	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        typePionButtonGroup = new javax.swing.ButtonGroup();
        panelInfoPion = new javax.swing.JPanel();
        nom = new javax.swing.JLabel();
        pv = new javax.swing.JLabel();
        porteeMin = new javax.swing.JLabel();
        portee = new javax.swing.JLabel();
        puissance = new javax.swing.JLabel();
        rayon = new javax.swing.JLabel();
        dissipation = new javax.swing.JLabel();
        prix = new javax.swing.JLabel();
        image = new javax.swing.JLabel();
        tabPanel = new javax.swing.JTabbedPane();
        tabAerienP = new javax.swing.JPanel();
        tabTerrestreP = new javax.swing.JPanel();
        tabNautiqueP = new javax.swing.JPanel();
        sousJoueur = new javax.swing.JLabel();
        bTerminer = new javax.swing.JButton();
        panelInfoPion1 = new javax.swing.JPanel();
        image1 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jSeparator3 = new javax.swing.JSeparator();
        nom3 = new javax.swing.JLabel();
        labelNom = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jSeparator4 = new javax.swing.JSeparator();
        nom4 = new javax.swing.JLabel();
        labelPv = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        jSeparator7 = new javax.swing.JSeparator();
        jPanel6 = new javax.swing.JPanel();
        jSeparator8 = new javax.swing.JSeparator();
        nom6 = new javax.swing.JLabel();
        labelportee = new javax.swing.JLabel();
        jSeparator10 = new javax.swing.JSeparator();
        jPanel7 = new javax.swing.JPanel();
        jSeparator11 = new javax.swing.JSeparator();
        nom7 = new javax.swing.JLabel();
        labelPuissance = new javax.swing.JLabel();
        jSeparator12 = new javax.swing.JSeparator();
        jPanel8 = new javax.swing.JPanel();
        jSeparator13 = new javax.swing.JSeparator();
        nom8 = new javax.swing.JLabel();
        labelRayon = new javax.swing.JLabel();
        jSeparator14 = new javax.swing.JSeparator();
        jPanel9 = new javax.swing.JPanel();
        jSeparator15 = new javax.swing.JSeparator();
        nom9 = new javax.swing.JLabel();
        labelDissipation = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jSeparator16 = new javax.swing.JSeparator();
        nom11 = new javax.swing.JLabel();
        labelPrix = new javax.swing.JLabel();
        jSeparator19 = new javax.swing.JSeparator();
        progressSous = new javax.swing.JProgressBar();
        nomJoueur = new javax.swing.JLabel();
        couleurJoueurPanel = new javax.swing.JPanel();

        nom.setText("Nom");

        pv.setText("PV");

        porteeMin.setText("PorteeMin");

        portee.setText("portee");

        puissance.setText("Puissance");

        rayon.setText("Rayon");

        dissipation.setText("Dissipation");

        prix.setText("Prix");

        image.setMaximumSize(new java.awt.Dimension(50, 50));
        image.setMinimumSize(new java.awt.Dimension(50, 50));
        image.setPreferredSize(new java.awt.Dimension(50, 50));

        javax.swing.GroupLayout panelInfoPionLayout = new javax.swing.GroupLayout(panelInfoPion);
        panelInfoPion.setLayout(panelInfoPionLayout);
        panelInfoPionLayout.setHorizontalGroup(
            panelInfoPionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(porteeMin)
            .addComponent(rayon)
            .addComponent(dissipation)
            .addGroup(panelInfoPionLayout.createSequentialGroup()
                .addComponent(prix)
                .addContainerGap(222, Short.MAX_VALUE))
            .addGroup(panelInfoPionLayout.createSequentialGroup()
                .addGroup(panelInfoPionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(portee)
                    .addComponent(puissance))
                .addContainerGap(172, Short.MAX_VALUE))
            .addGroup(panelInfoPionLayout.createSequentialGroup()
                .addGroup(panelInfoPionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nom)
                    .addComponent(pv))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 167, Short.MAX_VALUE)
                .addComponent(image, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        panelInfoPionLayout.setVerticalGroup(
            panelInfoPionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInfoPionLayout.createSequentialGroup()
                .addGroup(panelInfoPionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelInfoPionLayout.createSequentialGroup()
                        .addComponent(nom)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pv)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(porteeMin)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(portee)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(puissance)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(rayon)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dissipation)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(prix))
                    .addComponent(image, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        tabPanel.setPreferredSize(new java.awt.Dimension(250, 300));
        tabPanel.setRequestFocusEnabled(false);

        javax.swing.GroupLayout tabAerienPLayout = new javax.swing.GroupLayout(tabAerienP);
        tabAerienP.setLayout(tabAerienPLayout);
        tabAerienPLayout.setHorizontalGroup(
            tabAerienPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 272, Short.MAX_VALUE)
        );
        tabAerienPLayout.setVerticalGroup(
            tabAerienPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 273, Short.MAX_VALUE)
        );

        tabPanel.addTab("Aerien", tabAerienP);

        javax.swing.GroupLayout tabTerrestrePLayout = new javax.swing.GroupLayout(tabTerrestreP);
        tabTerrestreP.setLayout(tabTerrestrePLayout);
        tabTerrestrePLayout.setHorizontalGroup(
            tabTerrestrePLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 272, Short.MAX_VALUE)
        );
        tabTerrestrePLayout.setVerticalGroup(
            tabTerrestrePLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 273, Short.MAX_VALUE)
        );

        tabPanel.addTab("Terrestre", tabTerrestreP);

        javax.swing.GroupLayout tabNautiquePLayout = new javax.swing.GroupLayout(tabNautiqueP);
        tabNautiqueP.setLayout(tabNautiquePLayout);
        tabNautiquePLayout.setHorizontalGroup(
            tabNautiquePLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 272, Short.MAX_VALUE)
        );
        tabNautiquePLayout.setVerticalGroup(
            tabNautiquePLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 273, Short.MAX_VALUE)
        );

        tabPanel.addTab("Nautique", tabNautiqueP);

        sousJoueur.setText("Credit :");

        bTerminer.setText("Terminer");
        bTerminer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTerminerActionPerformed(evt);
            }
        });

        panelInfoPion1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        image1.setMaximumSize(new java.awt.Dimension(50, 50));
        image1.setMinimumSize(new java.awt.Dimension(50, 50));
        image1.setPreferredSize(new java.awt.Dimension(50, 50));

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom3.setText("Nom");

        labelNom.setText("D");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(nom3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(labelNom)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                        .addComponent(nom3))
                    .addComponent(labelNom))
                .addContainerGap())
        );

        jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom4.setText("Pv");

        labelPv.setText("D");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(nom4, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelPv)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator4, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom4)
                    .addComponent(labelPv))
                .addContainerGap())
        );

        jSeparator8.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom6.setText("Portée");

        labelportee.setText("D");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(nom6, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator8, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelportee)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator8, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom6)
                    .addComponent(labelportee))
                .addContainerGap())
        );

        jSeparator11.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom7.setText("Force");

        labelPuissance.setText("D");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(nom7, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator11, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelPuissance)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator11, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom7)
                    .addComponent(labelPuissance))
                .addContainerGap())
        );

        jSeparator13.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom8.setText("Rayon");

        labelRayon.setText("D");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(nom8, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator13, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelRayon)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator13, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom8)
                    .addComponent(labelRayon))
                .addContainerGap())
        );

        jSeparator15.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom9.setText("Héritage");

        labelDissipation.setText("D");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(nom9, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator15, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelDissipation)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator15, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom9)
                    .addComponent(labelDissipation))
                .addContainerGap())
        );

        jSeparator16.setOrientation(javax.swing.SwingConstants.VERTICAL);

        nom11.setText("Prix");

        labelPrix.setText("D");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(nom11, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jSeparator16, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(labelPrix)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator16, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE)
                    .addComponent(nom11)
                    .addComponent(labelPrix))
                .addContainerGap())
        );

        javax.swing.GroupLayout panelInfoPion1Layout = new javax.swing.GroupLayout(panelInfoPion1);
        panelInfoPion1.setLayout(panelInfoPion1Layout);
        panelInfoPion1Layout.setHorizontalGroup(
            panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInfoPion1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelInfoPion1Layout.createSequentialGroup()
                        .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(306, 306, 306)
                        .addComponent(image1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addComponent(jSeparator7, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                        .addGap(356, 356, 356))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(356, 356, 356))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator10, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(356, 356, 356))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator12, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(356, 356, 356))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator14, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(356, 356, 356))
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator19, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                        .addGap(356, 356, 356))))
        );
        panelInfoPion1Layout.setVerticalGroup(
            panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInfoPion1Layout.createSequentialGroup()
                .addGroup(panelInfoPion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(image1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelInfoPion1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        progressSous.setToolTipText("allo");
        progressSous.setValue(50);
        progressSous.setStringPainted(true);

        nomJoueur.setText("Joueur X");

        couleurJoueurPanel.setBackground(new java.awt.Color(255, 0, 0));
        couleurJoueurPanel.setPreferredSize(new java.awt.Dimension(15, 15));

        javax.swing.GroupLayout couleurJoueurPanelLayout = new javax.swing.GroupLayout(couleurJoueurPanel);
        couleurJoueurPanel.setLayout(couleurJoueurPanelLayout);
        couleurJoueurPanelLayout.setHorizontalGroup(
            couleurJoueurPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 15, Short.MAX_VALUE)
        );
        couleurJoueurPanelLayout.setVerticalGroup(
            couleurJoueurPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 15, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(tabPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panelInfoPion1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(sousJoueur)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(progressSous, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(bTerminer, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(couleurJoueurPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(nomJoueur)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(couleurJoueurPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nomJoueur, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(17, 17, 17)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sousJoueur)
                    .addComponent(progressSous, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(tabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelInfoPion1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(19, 19, 19)
                .addComponent(bTerminer)
                .addContainerGap())
        );

        progressSous.getAccessibleContext().setAccessibleDescription(null);
    }// </editor-fold>//GEN-END:initComponents

    private void bTerminerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bTerminerActionPerformed
		((EcouteurDeSourisEdition) aire.getEcouteur()).jCourantFini();
    }//GEN-LAST:event_bTerminerActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bTerminer;
    private javax.swing.JPanel couleurJoueurPanel;
    private javax.swing.JLabel dissipation;
    private javax.swing.JLabel image;
    private javax.swing.JLabel image1;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JSeparator jSeparator10;
    private javax.swing.JSeparator jSeparator11;
    private javax.swing.JSeparator jSeparator12;
    private javax.swing.JSeparator jSeparator13;
    private javax.swing.JSeparator jSeparator14;
    private javax.swing.JSeparator jSeparator15;
    private javax.swing.JSeparator jSeparator16;
    private javax.swing.JSeparator jSeparator19;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JLabel labelDissipation;
    private javax.swing.JLabel labelNom;
    private javax.swing.JLabel labelPrix;
    private javax.swing.JLabel labelPuissance;
    private javax.swing.JLabel labelPv;
    private javax.swing.JLabel labelRayon;
    private javax.swing.JLabel labelportee;
    private javax.swing.JLabel nom;
    private javax.swing.JLabel nom11;
    private javax.swing.JLabel nom3;
    private javax.swing.JLabel nom4;
    private javax.swing.JLabel nom6;
    private javax.swing.JLabel nom7;
    private javax.swing.JLabel nom8;
    private javax.swing.JLabel nom9;
    private javax.swing.JLabel nomJoueur;
    private javax.swing.JPanel panelInfoPion;
    private javax.swing.JPanel panelInfoPion1;
    private javax.swing.JLabel portee;
    private javax.swing.JLabel porteeMin;
    private javax.swing.JLabel prix;
    private javax.swing.JProgressBar progressSous;
    private javax.swing.JLabel puissance;
    private javax.swing.JLabel pv;
    private javax.swing.JLabel rayon;
    private javax.swing.JLabel sousJoueur;
    private javax.swing.JPanel tabAerienP;
    private javax.swing.JPanel tabNautiqueP;
    private javax.swing.JTabbedPane tabPanel;
    private javax.swing.JPanel tabTerrestreP;
    private javax.swing.ButtonGroup typePionButtonGroup;
    // End of variables declaration//GEN-END:variables
}
